﻿using DotNetStar.TheKing.Infrastructure;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;

namespace DotNetStar.TheKing.Web.Models
{
    public class LoginMobileCodeViewModel:IValidatableModel
    {
        [Required(ErrorMessage = "{0}不能为空")]
        [Display(Name = "手机号")]
        public string Mobile { get; set; }
        
        [Required(ErrorMessage = "{0}不能为空")]
        [Display(Name = "验证码")]
        public string Code { get; set; }
    }

    public class LoginMobilePasswordViewModel : IValidatableModel
    {
        [Required(ErrorMessage = "{0}不能为空")]
        [Display(Name = "手机号")]
        public string Mobile { get; set; }

        [Required(ErrorMessage = "{0}不能为空")]
        [Display(Name = "密码")]
        public string Password { get; set; }
    }

    public class RegisterViewModel : IValidatableModel
    {
        [Required(ErrorMessage = "{0}是必填项"), StringLength(20, ErrorMessage = "{0}必须在 {2}-{1} 个字符", MinimumLength = 2)]
        [Display(Name = "昵称")]
        public string UserName { get; set; }

        [Required(ErrorMessage = "{0}不能为空")]
        [Display(Name = "手机号")]
        public string Mobile { get; set; }

        [Required(ErrorMessage = "{0}不能为空")]
        [Display(Name = "验证码")]
        public string Code { get; set; }
    }
}
